package com.xoa.controller.party;

import com.xoa.model.party.IntegralManager;
import com.xoa.service.party.IntegralManagerService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by 程叶同 on 2018/1/12.
 */
@Controller
@RequestMapping("integralManger")
public class IntegralManagerController {

    @Autowired
    IntegralManagerService integralManagerService;

    @RequestMapping("/addData")
    @ResponseBody
    public BaseWrapper adaddDatad(HttpServletRequest request, IntegralManager integralManager){
        return integralManagerService.addData(request,integralManager);
    }
    @RequestMapping("/deleteData")
    @ResponseBody
    public BaseWrapper deleteData(HttpServletRequest request, Integer id){
        return integralManagerService.deleteData(id);
    }

    @RequestMapping("/updateData")
    @ResponseBody
    public BaseWrapper updateData(HttpServletRequest request, IntegralManager integralManager){
        return integralManagerService.updateData(integralManager);
    }

    @RequestMapping("/getDataById")
    @ResponseBody
    public BaseWrapper getDataById(HttpServletRequest request, Integer id){
        return integralManagerService.getDataById(request,id);
    }
    @RequestMapping("/getList")
    @ResponseBody
    public BaseWrapper getList(HttpServletRequest request, Integer page, Integer pageSize, boolean useFlag, String startTime, String endTime, String stepStatus, String status){
        return integralManagerService.getList(request,page,pageSize,useFlag,startTime,endTime,stepStatus,status);
    }

    @RequestMapping("/getDataByType")
    @ResponseBody
    public BaseWrapper getDataByType(Integer page, Integer pageSize, boolean useFlag, String type, String timeType, String partyId, String paixu){
        return integralManagerService.getDataByType(page,pageSize,useFlag,type,timeType,partyId,paixu);
    }

    @RequestMapping("/getPartybranchData")
    @ResponseBody
    public BaseWrapper getDataByType(Integer deptId){
        return integralManagerService.getPartybranchData(deptId);
    }

}
